#include <iostream>
#include <vector>        //提供向量头文件
#include <algorithm>     // 算法头文件，提供迭代器
#include <fstream>       //提供文件头文件
#include <iomanip>       //C++输出精度控制需要

using namespace std;

void readline(const char* strPath, int &line)
{
	ifstream is(strPath);
	char c;
	while (is.get(c))
	{
		if (c == '\n')
			line++;
	}
	is.close();
	cout << "line=" << line << endl;

}
int main()
{
	vector<double> V;
	vector<double>::iterator it;

	const char * filename = "D:\\test.txt";
	ifstream file(filename);
	
	double d;
	while (file >> d)
	{
		V.push_back(d);//将数据压入堆栈
	}
	file.close();
	int line = 1;
	readline(filename, line);
	double aa[100][2];
	for (it = V.begin(); it != V.end(); )
	{
		for (int i = 0; i < line; i++)//定义行循环
		{
			for (int j = 0; j < 2; j++)//定义列循环
			{
				aa[i][j] = *it; 
				it++;

			}
		}break;
	}

 
	return 0;
} 

